﻿using GrapeCity.ActiveReports.Design;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace GrapeCity.ActiveReports.Samples.CreateReport
{
    public partial class ReportTemplates : Form
    {
        public ReportTemplates()
        {
            InitializeComponent();
        }
        public DesignerReportType ReportType
        { get; set; }

        private void btnOk_Click(object sender, EventArgs e)
        {
            if (listView1.SelectedItems[0].Index == 0)
            {
                ReportType = DesignerReportType.Section;
            }
            else if (listView1.SelectedItems[0].Index == 1)
            {
                ReportType = DesignerReportType.Page;            
            }
            else if (listView1.SelectedItems[0].Index == 2)
            {
                ReportType = DesignerReportType.Rdl;            
            }
            else
            {
                this.DialogResult = System.Windows.Forms.DialogResult.Cancel;
                this.Close();
            }

            this.DialogResult = System.Windows.Forms.DialogResult.OK;
            this.Close();

        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            this.DialogResult = System.Windows.Forms.DialogResult.Cancel;
            this.Close();
        }
    }
}
